<!---
Name:        prodinfo.cfm
Author:      Dmitry Svito (prostotelo@gmail.com)
Description: client side product information
Created:     24.03.2011
--->

<head>
	<title>
		Joe's Catalog
		Product info
	</title>
</head>
<!--- Check URL parameter --->
<cfparam name="Prod" type="integer" default="0">

<cfif IsDefined("URL.prod")>
	<cfset Prod = "#URL.prod#">
<cfelse>
	<cflocation url="index.cfm">
</cfif>

<!---Products--->
<cfset ProdObjDAO	= createObject("component", "Catalog.DataAccessLayer.ProductsDAO").init() />
<cfset Product = ProdObjDAO.read(Prod)>

<!--- Include page header --->
<cfinclude template="/catalog/ViewLayer/header.cfm">

<!--- Product information output--->
<cfoutput>
	<a href = "index.cfm?cat=#Product.getrefCategoryID()#" target="_self">Back</a>
	<h1>#Product.getName()#</h1><br>
	Price: #Product.getPrice()#<br>
	<cfif Product.getImageName() IS NOT "">
		<img src="/catalog/images/#Product.getImageName()#" width="101" height="101" alt="" border="0"><br>
	<cfelse>
		<img src="/catalog/images/noimage.jpg" width="101" height="101" alt="" border="0"><br>
	</cfif>
	#Product.getDescription()#<br>
</cfoutput>

<!--- Include page footer --->
<cfinclude template="/catalog/ViewLayer/footer.cfm">